package com.wei.czz.framework.blog.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wei.czz.framework.blog.entity.BlogUserOperationEntity;
import org.apache.ibatis.annotations.Param;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wei
 * date: 2021-05-30 17:46:34
 * className: BlogUserOperationDao 用户操作博客请求数据库交互接口
 * version: 1.0
 * description:
 */
public interface BlogUserOperationDao extends BaseMapper<BlogUserOperationEntity> {

    /**
     * 根据用户id和博客id，获取用户最新一条点赞博客或者取消点赞博客记录
     * @param userId 用户id
     * @param blogId 博客id
     */
    Integer getUserLikeBlog(@Param("userId") Long userId, @Param("blogId") Long blogId);

    /**
     * 根据用户id和博客id，获取用户最新一条收藏博客或者取消收藏博客记录
     * @param userId 用户id
     * @param blogId 博客id
     */
    Integer getUserCollectBlog(@Param("userId") Long userId, @Param("blogId") Long blogId);
}
